import subprocess

class Shell:
    @staticmethod
    def execute(cmd):
        output,errors = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
        out_msg = output.decode('gbk')
        return  out_msg
if __name__ == '__main__':
    print(Shell.execute('dir'))